﻿
using FB.Providers.EmployeeInfo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;

namespace FB.Providers
{
   public static class PositionManager
    {
       // #region Position 岗位
       //public static EmployeeInfoUnit EmployeeInfoUnit
       //{
       //    get
       //    {
       //        var EF = AspNetEmployeeInfoProviderManager.Default as EFEmployeeInfoProvider;
       //        if (null != EF)
       //        {
       //            return EF.GetEmployeeInfoUnit();
       //        }
       //        return null;
       //    }
       //}
       // public static Position GetPosition(string POSCode)
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     var query = infounit.PositionRepository.Get(t => t.POSCode == POSCode, null, "ParentPosition");
       //     return query.FirstOrDefault();
            
       // }

       // public static List<Position> GetAllPositions()
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     return infounit.PositionRepository.Get(null, null, "ParentPosition").ToList();
            
       // }

       // public static List<Position> FindPositions(Expression<Func<Position, bool>> filter = null)
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     return infounit.PositionRepository.Get(filter, null, "ParentPosition").ToList();
          
       // }

       // public static Position CreatePosition(Position position)
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     Position pos = infounit.PositionRepository.Insert(position);
       //     infounit.SaveChanges();
       //   return pos;
           
       // }

       // public static void UpdatePosition(Position position)
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     infounit.PositionRepository.Update(position);
       //     infounit.SaveChanges();
            
       // }

       // public static void DeletePosition(string POSCode)
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     infounit.PositionRepository.Delete(POSCode);
       //     infounit.SaveChanges();
            
       // }
       // public static List<Position> FindPositions(
       //   Expression<Func<Position, bool>> filter,
       //   Func<IQueryable<Position>, IOrderedQueryable<Position>> orderBy,
       //   int pageIndex, int pageSize, out int totalRecords)
       // {
       //     EmployeeInfoUnit infounit = EmployeeInfoUnit;
       //     return infounit.PositionRepository.GetPagedList(filter, orderBy, pageIndex, pageSize, out totalRecords, "ParentPosition").ToList(); 
       // }
       // #endregion
    }
}
